package com.qianli.cashmama.trade.common.enums;


/**
 * 签名 状态
 *
 * @author zsp
 */
public enum TradeSignStatusEnum {
    /**/
    INIT(0, "初始化"),
    SIGN_SUCCESS(1, "成功"),
    SIGN_FAILED(2, "失败"),
    SIGN_NAME_NOT_MATCH(3, "签名后获取姓名不匹配"),
    SIGN_TIMEOUT(4, "签约超时");//默认7天

    private int status;
    private String desc;

    TradeSignStatusEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public int getStatus() {
        return status;
    }

    public TradeSignStatusEnum setStatus(int status) {
        this.status = status;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TradeSignStatusEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static TradeSignStatusEnum convertByStatus(int status) {
        TradeSignStatusEnum tradeSignStatusEnum = null;
        for (TradeSignStatusEnum signStatusEnum : TradeSignStatusEnum.values()) {
            if (signStatusEnum.getStatus() == status) {
                tradeSignStatusEnum = signStatusEnum;
                break;
            }
        }
        return tradeSignStatusEnum;
    }
}
